garmin_gpi: Seek to image offset in case there's additional headers in the
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 9 Jun 2013 23:16:41 +0000 (23:16 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 9 Jun 2013 23:16:41 +0000 (23:16 +0000)
bmp, such as those inserted by gimp, etc.
Fix warning when compiling with debug.

gpsbabel/garmin_gpi.cc

index 11a6cd37b469a5e82be3eb3cd486b7a1d39e79bf..c2304236f34029b7c4e823b9e6cb4426f37b0b94 100644 (file)
@@ -1368,6 +1368,8 @@ load_bitmap_from_file(const char* fname, unsigned char** data, int* data_sz)
   ptr = (unsigned char*)dest_h;
   ptr += (sizeof(*dest_h) + (dest_line_sz * (src_h.height - 1)));
 
+  gbfseek(f, src_h.image_offset, SEEK_SET);
+
   if (src_h.bpp == 24) {
     /* 24 bpp seems to be not supported, convert to 32 bpp */
     for (i = 0; i < src_h.height; i++) {